// time_point_cast
#include <chrono>
#include <iostream>
#include <ratio>

int main() {
  using namespace std::chrono;

  typedef duration<int, std::ratio<60 * 60 * 24>> days_type; //定义一天时间

  time_point<system_clock, days_type> today = time_point_cast<days_type>(
      system_clock::now()); //获取今天的日期转换为定义的天的时间跨度

  std::cout << today.time_since_epoch().count()
            << " days since epoch" //按天算离起始时间多少天
            << std::endl;

  return 0;
}
